﻿using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using YArchitech.LIB;
using HYFamilyLibDataManager;

namespace HYFamilyLibManager.FamilyLibModule
{
	public partial class DlgExceptionInfo : System.Windows.Forms.Form
	{
		public DlgExceptionInfo(ExceptionInfo info, int count, int num)
		{
			this.InitializeComponent();
			this.info = info;
			this.count = count;
			this.num = num;
		}

		private void button1_Click(object sender, EventArgs e)
		{
			base.Close();
		}

		private void DlgExceptionInfo_Load(object sender, EventArgs e)
		{
			base.Icon = Resource.YArchitechIcon;
			this.label1.Text = string.Concat(new object[]
			{
				"导入的文件夹中共",
				this.count,
				"个族文件，导入成功",
				this.num,
				"个，失败",
				this.count - this.num,
				"个。"
			});
			this.lvwExcept.FullRowSelect = true;
			this.lvwExcept.GridLines = true;
			this.lvwExcept.BeginUpdate();
			foreach (NameException ex in this.info.names)
			{
				ListViewItem listViewItem = new ListViewItem();
				listViewItem.Text = ex.Name;
				listViewItem.ToolTipText = ex.Name;
				listViewItem.SubItems.Add(ex.Path);
				listViewItem.SubItems.Add("族重复");
				this.lvwExcept.Items.Add(listViewItem);
			}
			foreach (VersionException ex2 in this.info.vers)
			{
				ListViewItem listViewItem2 = new ListViewItem();
				listViewItem2.Text = ex2.Name;
				listViewItem2.ToolTipText = ex2.Name;
				listViewItem2.SubItems.Add(ex2.Path);
				listViewItem2.SubItems.Add("高版本");
				this.lvwExcept.Items.Add(listViewItem2);
			}
			foreach (ParamException ex3 in this.info.paramExceptions)
			{
				ListViewItem listViewItem3 = new ListViewItem();
				listViewItem3.Text = ex3.Name;
				listViewItem3.ToolTipText = ex3.Name;
				listViewItem3.SubItems.Add(ex3.Path);
				listViewItem3.SubItems.Add("族不包含分类关键参数");
				this.lvwExcept.Items.Add(listViewItem3);
			}
			foreach (CategoryException ex4 in this.info.categorys)
			{
				ListViewItem listViewItem4 = new ListViewItem();
				listViewItem4.Text = ex4.Name;
				listViewItem4.ToolTipText = ex4.Name;
				listViewItem4.SubItems.Add(ex4.Path);
				listViewItem4.SubItems.Add("同级目录名重复");
				this.lvwExcept.Items.Add(listViewItem4);
			}
			this.lvwExcept.EndUpdate();
		}

		private ExceptionInfo info = new ExceptionInfo();

		private int count;

		private int num;
	}
}
